package njci.softerware.com.myexpress2017.serviceObj;

import android.os.Parcel;
import android.os.Parcelable;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

/**
 * Created by 徐连宝 on 2016/9/9.
 */
@DatabaseTable(tableName = "user_info")
public class ExpressUser implements Parcelable {

    /**
     * account : 3
     * id : 16
     * name : admin
     * pwd : admin
     * rank : 2
     */
    @DatabaseField(columnName = "keyId", generatedId = true)
    private Integer keyId;

    @DatabaseField(columnName = "account")
    private int account;
    @DatabaseField(columnName = "id")
    private int id;
    @DatabaseField(columnName = "name")
    private String name;
    @DatabaseField(columnName = "pwd")
    private String pwd;
    @DatabaseField(columnName = "rank")
    private int rank;
    @DatabaseField(columnName = "phone")
    private String phone;

    public Integer getKeyId() {
        return keyId;
    }

    public void setKeyId(int keyId) {
        this.keyId = keyId;
    }

    public int getAccount() {
        return account;
    }

    public void setAccount(int account) {
        this.account = account;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public int getRank() {
        return rank;
    }

    public void setRank(int rank) {
        this.rank = rank;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.account);
        dest.writeInt(this.id);
        dest.writeString(this.name);
        dest.writeString(this.pwd);
        dest.writeInt(this.rank);
        dest.writeString(this.phone);
    }

    public ExpressUser() {
    }

    protected ExpressUser(Parcel in) {
        this.keyId = in.readInt();
        this.account = in.readInt();
        this.id = in.readInt();
        this.name = in.readString();
        this.pwd = in.readString();
        this.rank = in.readInt();
        this.phone=in.readString();
    }


    public static final Parcelable.Creator<ExpressUser> CREATOR = new Parcelable.Creator<ExpressUser>() {
        public ExpressUser createFromParcel(Parcel source) {
            return new ExpressUser(source);
        }

        public ExpressUser[] newArray(int size) {
            return new ExpressUser[size];
        }
    };
}
